package edu.kaist.cs442.server.locationalpush.register;

import edu.kaist.cs442.server.locationalpush.common.mobile.MobileDAO;
import edu.kaist.cs442.server.locationalpush.common.mobile.MobileVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;

/**
 * Created by IntelliJ IDEA.
 * User: duyleekun
 * Date: 2/28/12
 * Time: 8:05 PM
 * To change this template use File | Settings | File Templates.
 */

@Configurable
public class RegisterSVCImpl implements RegisterSVC {

    @Autowired(required = true)
    private MobileDAO mobileDAO;

    public MobileDAO getMobileDAO() {
        return mobileDAO;
    }

    public void setMobileDAO(MobileDAO mobileDAO) {
        this.mobileDAO = mobileDAO;
    }

    @Override
    public String register(String uuid, String register_id) {
        MobileVO newMobile = new MobileVO(uuid, register_id);
        int count = mobileDAO.update(newMobile);
        return Integer.toString(count);
    }
}
